<!doctype html>
<html lang="zh-cn">
  <head>
  <meta charset="utf-8">
<title>系统管理和自动化运维(网络篇) - Huanghs blog</title>
<meta name="viewport" content="width=device-width, initial-scale=1">


  <link rel="apple-touch-icon" sizes="180x180" href="/favicon/apple-touch-icon.png?v=1">
  <link rel="icon" type="image/png" sizes="32x32" href="/favicon/favicon-32x32.png?v=1">
  <link rel="icon" type="image/png" sizes="16x16" href="/favicon/favicon-16x16.png?v=1">
  <link rel="manifest" href="/favicon/site.webmanifest?v=1">
  
    <link rel="mask-icon" href="/favicon/safari-pinned-tab.svg?v=1" color="#ffffff">
    <link rel="shortcut icon" href="/favicon/favicon.ico?v=1">
    <meta name="msapplication-config" content="/favicon/browserconfig.xml?v=1">
  
  <meta name="msapplication-TileColor" content="#ffffff">
  <meta name="theme-color" content="#ffffff">

<meta name="generator" content="Hugo 0.66.0" /><meta itemprop="name" content="系统管理和自动化运维(网络篇)">
<meta itemprop="description" content="本篇基于赖明星的Python Linux系统管理与自动化运维.本书以Linux系统管理为线索，以Python语言为载体，介绍了大量Python语言的应用案例。通过学习本书，读者不但可以使用Python语言管理Linux系统，而且，也为Python解决其他领域问题打下了坚实的基础。">
<meta itemprop="datePublished" content="2020-03-13T00:00:00&#43;08:00" />
<meta itemprop="dateModified" content="2020-03-13T00:00:00&#43;08:00" />
<meta itemprop="wordCount" content="264">
<meta itemprop="image" content="https://raw.githubusercontent.com/hhs44/cloudimg/master/img/20200313221843.png">



<meta itemprop="keywords" content="Automated test," /><meta property="og:title" content="系统管理和自动化运维(网络篇)" />
<meta property="og:description" content="本篇基于赖明星的Python Linux系统管理与自动化运维.本书以Linux系统管理为线索，以Python语言为载体，介绍了大量Python语言的应用案例。通过学习本书，读者不但可以使用Python语言管理Linux系统，而且，也为Python解决其他领域问题打下了坚实的基础。" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://hhs44.github.io/blog/2020-03-13-python-linux%E7%B3%BB%E7%BB%9F%E7%AE%A1%E7%90%86%E5%92%8C%E8%87%AA%E5%8A%A8%E5%8C%96%E8%BF%90%E7%BB%B4%E4%B8%80/" />
<meta property="og:image" content="https://raw.githubusercontent.com/hhs44/cloudimg/master/img/20200313221843.png" />
<meta property="article:published_time" content="2020-03-13T00:00:00+08:00" />
<meta property="article:modified_time" content="2020-03-13T00:00:00+08:00" />
<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:image" content="https://raw.githubusercontent.com/hhs44/cloudimg/master/img/20200313221843.png"/>

<meta name="twitter:title" content="系统管理和自动化运维(网络篇)"/>
<meta name="twitter:description" content="本篇基于赖明星的Python Linux系统管理与自动化运维.本书以Linux系统管理为线索，以Python语言为载体，介绍了大量Python语言的应用案例。通过学习本书，读者不但可以使用Python语言管理Linux系统，而且，也为Python解决其他领域问题打下了坚实的基础。"/>
<meta name="twitter:site" content="@example"/>
<link rel="stylesheet" href="/css/bundle.min.b2b2abee095149a60c0a1a2c4fab4b7c140b32ca88abc3d2f83d0dd903b6f634.css" integrity="sha256-srKr7glRSaYMChosT6tLfBQLMsqIq8PS&#43;D0N2QO29jQ=">
        <link rel="stylesheet" href="/css/add-on.css">

</head>

  <body>
    
<header id="site-header">
  <nav id="site-nav">
    <h1 class="nav-title">
      <a href="/">
        
          
            博客
          
        
      </a>
    </h1>
    <menu id="site-nav-menu" class="flyout-menu">
      
        
          
          
            <a href="/" class="link"><i class='fa fa-home'></i> 首页</a>
          
        
      
        
          
          
            <a href="/blog/" class="link"><i class='far fa-newspaper'></i> 博客</a>
          
        
      
        
          
          
            <a href="/categories/" class="link"><i class='fas fa-sitemap'></i> 分类</a>
          
        
      
        
          
          
            <a href="/tags/" class="link"><i class='far fa-envelope'></i> 标签</a>
          
        
      
        
          
          
            <a href="/about/" class="link"><i class='far fa-id-card'></i> 关于</a>
          
        
      
      <a href="#share-menu" class="share-toggle"><i class="fas fa-share-alt">&nbsp;</i>Share</a>
      

    </menu>
    

    <a href="#share-menu" class="share-toggle"><i class="fas fa-share-alt fa-2x">&nbsp;</i></a>
    <a href="#lang-menu" class="lang-toggle" lang="zh-cn">zh-cn</a>
    <a href="#site-nav" class="nav-toggle"><i class="fas fa-bars fa-2x"></i></a>
  </nav>
  <menu id="lang-menu" class="flyout-menu">
  <a href="#" lang="zh-cn" class="link active">中文 (zh-cn)</a>
  
    
      
        <a href="/en" lang="en" class="no-lang link">English (en)</a>
      
    
      
    
  
</menu>

  
    <menu id="share-menu" class="flyout-menu">
      <h1>Share Post</h1>
      





    </menu>
  
</header>


    <div id="wrapper">
      <section id="site-intro">
  <a href="/"><img src="https://raw.githubusercontent.com/hhs44/cloudimg/master/img/head.jpg" class="circle" width="" alt="huang`s blog " /></a>
  <header>
    <h1>Huanghs的个人博客 </h1>
  </header>
  <main>
    <p>不写下一些东西，就没法证明自己<br> 不多走一些路，就没法看到更多的风景</p>
  </main>
  
    <footer>
      <ul class="socnet-icons">
        

        <li><a href="//github.com/hhs44/hhs44.github.io" target="_blank" rel="noopener" title="GitHub" class="fab fa-github"></a></li>






<li><a href="//flickr.com/photos/example" target="_blank" rel="noopener" title="Flickr" class="fab fa-flickr"></a></li>




<li><a href="//linkedin.com/in/example" target="_blank" rel="noopener" title="LinkedIn" class="fab fa-linkedin"></a></li>
<li><a href="//linkedin.com/company/examplebusiness" target="_blank" rel="noopener" title="LinkedIn Company" class="fab fa-linkedin"></a></li>



<li><a href="//facebook.com/example" target="_blank" rel="noopener" title="Facebook" class="fab fa-facebook"></a></li>
<li><a href="//reddit.com/user/example" target="_blank" rel="noopener" title="Reddit" class="fab fa-reddit"></a></li>





<li><a href="weixin://contacts/profile/22" target="_blank" rel="noopener" title="WeChat" class="fab fa-weixin"></a></li>
<li><a href="//wpa.qq.com/msgrd?v=3&amp;uin=1159986871&amp;site=qq&amp;menu=yes" target="_blank" rel="noopener" title="QQ" class="fab fa-qq"></a></li>
<li><a href="//instagram.com/example" target="_blank" rel="noopener" title="Instagram" class="fab fa-instagram"></a></li>

<li><a href="//twitter.com/example" target="_blank" rel="noopener" title="Twitter" class="fab fa-twitter"></a></li>


<li><a href="//pinterest.com/example" target="_blank" rel="noopener" title="Pinterest" class="fab fa-pinterest-p"></a></li>
<li><a href="//telegram.me/example" target="_blank" rel="noopener" title="telegram" class="fab fa-telegram"></a></li>



<li><a href="//researchgate.net/profile/example" target="_blank" rel="noopener" title="Research Gate"><i class="ai ai-researchgate"></i></a></li>
<li><a href="//keybase.io/example" target="_blank" rel="noopener" title="keybase" class="fab fa-keybase"></a></li>
<li><a href="//example.com/@example" target="_blank" rel="noopener" title="mastodon" class="fab fa-mastodon"></a></li>
<li><a href="mailto:1159986871@qq.com" target="_blank" title="Email" class="far fa-envelope"></a></li>

      </ul>
    </footer>
  
</section>


      <main id="site-main">
        <article class="post">
  <header>
  <div class="title">
    
        <h2><a href="/blog/2020-03-13-python-linux%E7%B3%BB%E7%BB%9F%E7%AE%A1%E7%90%86%E5%92%8C%E8%87%AA%E5%8A%A8%E5%8C%96%E8%BF%90%E7%BB%B4%E4%B8%80/">系统管理和自动化运维(网络篇)</a></h2>
    
    
        <p>本篇基于赖明星的Python Linux系统管理与自动化运维.本书以Linux系统管理为线索，以Python语言为载体，介绍了大量Python语言的应用案例。通过学习本书，读者不但可以使用Python语言管理Linux系统，而且，也为Python解决其他领域问题打下了坚实的基础。</p>
    
</div>
  <div class="meta">
    <time class="published" datetime="2020-03-13 00:00:00 &#43;0800 CST">
      March 13, 2020
    </time>
    <span class="author">H浩书</span>
    
      <p>2 分钟</p>
    
  </div>
</header>

  <section id="socnet-share">
    





  </section>
  
  <a href="/blog/2020-03-13-python-linux%E7%B3%BB%E7%BB%9F%E7%AE%A1%E7%90%86%E5%92%8C%E8%87%AA%E5%8A%A8%E5%8C%96%E8%BF%90%E7%BB%B4%E4%B8%80/" class="image featured">
    
      <img src="https://raw.githubusercontent.com/hhs44/cloudimg/master/img/20200313221843.png" alt="">
    
  </a>


  <div class="content">
    <p>python的应用领域已经是众所周知的非常广泛，那么在网络上它是怎么大展神通的呢。</p>
<p>本次主要会介绍：</p>
<ul>
<li>用python列出网络上活跃的所有主机。</li>
<li>python中的端口扫描工具</li>
<li>进行ip管理</li>
<li>一个DNS工具包</li>
<li>网络嗅探</li>
<li></li>
</ul>
<h1 id="列出网络上活跃的所有主机">列出网络上活跃的所有主机</h1>
<p>和网络相关，你接触到的第一个命令一定是ping命令，它可以探测到主机到主机之间是否能够通信。ping命令可以通过网络设备的回复得知两台主机的连通性以及主机之间的网络延迟。</p>
<p>使用案例：</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell">$ping www.baidu.com
<span style="color:#75715e">#得到结果如下：</span>
<span style="color:#75715e">#正在 Ping www.a.shifen.com [14.215.177.39] 具有 32 字节的数据:</span>
<span style="color:#75715e">#来自 14.215.177.39 的回复: 字节=32 时间=37ms TTL=54</span>
<span style="color:#75715e">#来自 14.215.177.39 的回复: 字节=32 时间=37ms TTL=54</span>
<span style="color:#75715e">#来自 14.215.177.39 的回复: 字节=32 时间=38ms TTL=54</span>
<span style="color:#75715e">#来自 14.215.177.39 的回复: 字节=32 时间=37ms TTL=54</span>

<span style="color:#75715e">#14.215.177.39 的 Ping 统计信息:</span>
<span style="color:#75715e">#    数据包: 已发送 = 4，已接收 = 4，丢失 = 0 (0% 丢失)，</span>
<span style="color:#75715e">#往返行程的估计时间(以毫秒为单位):</span>
<span style="color:#75715e">#    最短 = 37ms，最长 = 38ms，平均 = 37ms</span>
</code></pre></div><p>如果主机不可达：则会返回<code>Destination Host Unreachable</code>的错误信息。</p>
<p>注：ping发送的数据是互联网控制协议（ICMP）中的ECHO_REQUEST数据报</p>
<p>ping的控制选项：</p>
<ul>
<li>-c：限制发送的ECHO_REQUEST数据报的数量，默认是无限制。</li>
</ul>
<p>那么如何使用ping命令在shell脚本中获得网络上活跃的主机列表。</p>
<blockquote>
<p>分析：</p>
<p>​	在程序中可以通过ping命令的返回码判断主机是否可达，主机活跃时返回码为0，主机不可达时返回码非零。</p>
</blockquote>
<p>shell程序如下：</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-shell" data-lang="shell"><span style="color:#66d9ef">for</span> ip in <span style="color:#e6db74">&#39;cat ips.txt&#39;</span>
<span style="color:#66d9ef">do</span>
	<span style="color:#66d9ef">if</span> ping $ip -c <span style="color:#ae81ff">2</span> &amp;&gt; /dev/null
	<span style="color:#66d9ef">then</span>
		echo <span style="color:#e6db74">&#34;</span>$ip<span style="color:#e6db74"> is alive&#34;</span>
	<span style="color:#66d9ef">else</span>
		echo <span style="color:#e6db74">&#34;</span>$ip<span style="color:#e6db74"> is unreachable&#34;</span>
	<span style="color:#66d9ef">fi</span>
<span style="color:#66d9ef">done</span>
</code></pre></div><p>以上例子中，主机地址以每行一个地址的形式保存到ips.txt文件中，然后使用cat命令读取文件中内容，使用for迭代ips.txt中保存的主机。</p>
<p>同时，<code>if ping $ip -c 2 &amp;&gt; /dev/null</code>的操作使ping输出信息输出到/dev/null中，以免信息在终端上打印。</p>
<p>接下来使用python实现以上功能：</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-python" data-lang="python"><span style="color:#f92672">from</span> __future__ <span style="color:#f92672">import</span> print_function
<span style="color:#f92672">import</span> subprocess
<span style="color:#f92672">import</span> threading


<span style="color:#66d9ef">def</span> <span style="color:#a6e22e">is_reacheable</span>(ip):
    <span style="color:#66d9ef">if</span> <span style="color:#f92672">not</span> subprocess<span style="color:#f92672">.</span>call([<span style="color:#e6db74">&#34;ping&#34;</span>,ip,<span style="color:#e6db74">&#34;-n&#34;</span>,<span style="color:#e6db74">&#34;1&#34;</span>],shell<span style="color:#f92672">=</span>True):
        <span style="color:#66d9ef">print</span>(<span style="color:#e6db74">&#34;{} is alive&#34;</span><span style="color:#f92672">.</span>format(ip))
    <span style="color:#66d9ef">else</span>:
        <span style="color:#66d9ef">print</span>(<span style="color:#e6db74">&#34;{} is unreacheable&#34;</span><span style="color:#f92672">.</span>format(ip))


<span style="color:#66d9ef">def</span> <span style="color:#a6e22e">main</span>():
    <span style="color:#66d9ef">with</span> open(<span style="color:#e6db74">&#34;ips.txt&#34;</span>) <span style="color:#66d9ef">as</span> f:
        lines <span style="color:#f92672">=</span> f<span style="color:#f92672">.</span>readlines()
        threads <span style="color:#f92672">=</span> []
        <span style="color:#66d9ef">for</span> line <span style="color:#f92672">in</span> lines:
            thr <span style="color:#f92672">=</span> threading<span style="color:#f92672">.</span>Thread(target<span style="color:#f92672">=</span>is_reacheable, args<span style="color:#f92672">=</span>(line,))
            thr<span style="color:#f92672">.</span>start()
            threads<span style="color:#f92672">.</span>append(thr)
        <span style="color:#66d9ef">for</span> thr <span style="color:#f92672">in</span> threads:
            thr<span style="color:#f92672">.</span>join()


<span style="color:#66d9ef">if</span> __name__ <span style="color:#f92672">==</span> <span style="color:#e6db74">&#39;__main__&#39;</span>:
    main()
</code></pre></div><p>以上案例中使用线程的方法，给每个IP创建一个线程，由于线程之间不共享任何数据，因此不需要进行并发控制。在python中要判断两台主机是否可达主要有两种方式，一种时在python中调用ping命令，另一种是使用socket编程发送icmp数据。</p>
<p>使用python的区别在于python程序使用并发加快了程序的执行效率，同时实现并发的代码量也较少很便捷。</p>
<h2 id="生产者消费者模型">生产者消费者模型</h2>
<p>当然上面的例子也存在一定的问题，当ip数较多时会有频繁的上下文切换。因此需要对于线程的数目进行限制。这里使用生产者和消费者模型就可以解决问题。</p>
<blockquote>
<p>生产者消费者问题简单的说，就是增加缓存机制和等待机制。生产者放入缓存商品，放满后等待，消费者获取商品，没有商品则等待。</p>
</blockquote>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-python" data-lang="python"><span style="color:#f92672">from</span> __future__ <span style="color:#f92672">import</span> print_function
<span style="color:#f92672">import</span> subprocess
<span style="color:#f92672">import</span> threading
<span style="color:#f92672">import</span> queue


<span style="color:#66d9ef">def</span> <span style="color:#a6e22e">call_ping</span>(ip):
    x <span style="color:#f92672">=</span> subprocess<span style="color:#f92672">.</span>call([<span style="color:#e6db74">&#34;ping&#34;</span>, ip, <span style="color:#e6db74">&#34;-n&#34;</span>, <span style="color:#e6db74">&#34;1&#34;</span>], shell<span style="color:#f92672">=</span>True)
    <span style="color:#66d9ef">if</span> <span style="color:#f92672">not</span> x:
        <span style="color:#66d9ef">print</span>(<span style="color:#e6db74">&#34;{} is alive&#34;</span><span style="color:#f92672">.</span>format(ip))
    <span style="color:#66d9ef">else</span>:
        <span style="color:#66d9ef">print</span>(<span style="color:#e6db74">&#34;{} is unreacheable&#34;</span><span style="color:#f92672">.</span>format(ip))
<span style="color:#66d9ef">def</span> <span style="color:#a6e22e">is_reacheable</span>(q):
    <span style="color:#66d9ef">try</span>:
        <span style="color:#66d9ef">while</span> True:
            ip <span style="color:#f92672">=</span> q<span style="color:#f92672">.</span>get_nowait()
            call_ping(ip)
    <span style="color:#66d9ef">except</span> <span style="color:#a6e22e">Exception</span>:
        <span style="color:#66d9ef">pass</span>
<span style="color:#66d9ef">def</span> <span style="color:#a6e22e">main</span>():
    q <span style="color:#f92672">=</span> queue<span style="color:#f92672">.</span>Queue()
    <span style="color:#66d9ef">with</span> open(<span style="color:#e6db74">&#34;ips.txt&#34;</span>) <span style="color:#66d9ef">as</span> f:
        <span style="color:#66d9ef">for</span> line <span style="color:#f92672">in</span> f:
            q<span style="color:#f92672">.</span>put(line)
    threads <span style="color:#f92672">=</span> []
    <span style="color:#66d9ef">for</span> i <span style="color:#f92672">in</span> range(<span style="color:#ae81ff">10</span>):
        thr <span style="color:#f92672">=</span> threading<span style="color:#f92672">.</span>Thread(target<span style="color:#f92672">=</span>is_reacheable, args<span style="color:#f92672">=</span>(q,))
        thr<span style="color:#f92672">.</span>start()
        threads<span style="color:#f92672">.</span>append(thr)
    <span style="color:#66d9ef">for</span> thr <span style="color:#f92672">in</span> threads:
        thr<span style="color:#f92672">.</span>join()
<span style="color:#66d9ef">if</span> __name__ <span style="color:#f92672">==</span> <span style="color:#e6db74">&#39;__main__&#39;</span>:
    main()

</code></pre></div><p>这里使用了队列的方法，队列是先进先出的数据结构。所有的ip读入内存并放入Queue中，消费者不断从中获取商品，当没有商品时线程将会阻塞，直到有新的ip进入。</p>
<h1 id="端口扫描">端口扫描</h1>
<p>端口扫描是为了我们能够快速了解主机打开了哪些不必要的端口，以便及时消灭隐患。</p>
<p>首先判断一个端口是否能打开，可以使用telent命令。直接参照上一个例子在python代码中调用telnet命令判断一个端口是否打开。</p>
<p>这里我们会使用到socket模块，该模块为操作系统的socket连接提供了一个python接口。默认情况下socket函数会返回一个使用tcp协议的socket对象。如下：</p>
<div class="highlight"><pre style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-python" data-lang="python"><span style="color:#f92672">import</span> socket
s<span style="color:#f92672">=</span>socket<span style="color:#f92672">.</span>socket()
s<span style="color:#f92672">.</span>connect((<span style="color:#e6db74">&#39;123.56.80.63&#39;</span>,<span style="color:#ae81ff">80</span>))
s<span style="color:#f92672">.</span>send(<span style="color:#e6db74">&#34;GET / HTTP/1.0 </span><span style="color:#ae81ff">\r\n</span><span style="color:#e6db74">&#34;</span>)
<span style="color:#66d9ef">print</span>(s<span style="color:#f92672">.</span>recv(<span style="color:#ae81ff">200</span>))
<span style="color:#75715e">#输出的结果不是重点，，，我没得出来</span>
</code></pre></div><p>再来一个端口扫描器，看能不能跑</p>
<p>emm不能</p>
<p>未完待续</p>
  </div>
  <footer>
    <ul class="stats">
  
    
    
      <li class="categories">
        <ul>
          
            
            <li><a class="article-category-link" href="https://hhs44.github.io/categories/python">python</a></li>
          
            
            <li><a class="article-category-link" href="https://hhs44.github.io/categories/test">test</a></li>
          
            
            <li><a class="article-category-link" href="https://hhs44.github.io/categories/linux">linux</a></li>
          
        </ul>
      </li>
    
  
  
    
    
      <li class="tags">
        <ul>
          
            
            <li><a class="article-category-link" href="https://hhs44.github.io/tags/automated-test">Automated test</a></li>
          
        </ul>
      </li>
    
  
</ul>

  </footer>
</article>

    <article class="post">
      
<div>
  <h2>说些什么</h2>
    <form id="post-js-form" class="post-new-comment" method="POST">
      
      <h5 class='post-reply-notice hidden'>
        <span class='post-reply-arrow'></span><span class='post-reply-name'></span>
      </h5>

      
      <input type="hidden" name="options[entryId]" value="0e841b2f577976175561f69b2fa8c0ac">
      <input type='hidden' name='fields[replyThread]' value=''>
      <input type='hidden' name='fields[replyID]' value=''>
      <input type='hidden' name='fields[replyName]' value=''>

      
      <input required name='fields[name]' type='text' placeholder='您的名字（必填）'>
      <input name='fields[website]' type='text' placeholder='您的网站'>
      <input required name='fields[email]' type='email' placeholder='您的电邮地址（必填，用于 Gravatar 头象）'>
      <textarea required name='fields[body]' placeholder='您的留言。可使用 Markdown。（搜索 &#39;Markdown 語法速查&#39;）' rows='10'></textarea>

      
      

      
      <p class='post-submit-notice'>
        <strong class='post-submit-notice-text submit-success hidden'>感谢您的评论！被批准后它会立即在此站点展示。</strong>
        <strong class='post-submit-notice-text submit-failed hidden'>很抱歉，您的提交存在错误。请确保所有必填字段都已填写正确，然后再试一次。</strong>
      </p>

      
      <input type='submit' value='送出' class='button'>
      <input type='submit' value='已送出' class='hidden button' disabled>
      <input type='reset' value='重设' class='button'>
    </form>
</div>


<div>
  <h2>评论</h2>

  
    
      <p>还沒有留言。</p>
    
  
</div>

    </article>


<div class="pagination">
  
    <a href="/blog/markdown-reference-/" class="button"><div class="previous"><div>Markdown For Typora</div></div></a>
  
  
    <a href="/blog/2020-03-14%E6%B5%8B%E8%AF%95%E7%90%86%E8%AE%BA/" class="button"><div class="next"><div>测试理论</div></div></a>
  
</div>


      </main>
      <div class="post-toc">
     
    <aside>
        <header>
        <h4>系统管理和自动化运维(网络篇)的字数: 264</h4> 
        </header><nav id="TableOfContents">
  <ul>
    <li><a href="#列出网络上活跃的所有主机">列出网络上活跃的所有主机</a>
      <ul>
        <li><a href="#生产者消费者模型">生产者消费者模型</a></li>
      </ul>
    </li>
    <li><a href="#端口扫描">端口扫描</a></li>
  </ul>
</nav></aside>
    <a href="#" id="toc-toggle"></a>
     
</div>
      <section id="site-sidebar">
  
    <section id="recent-posts">
      <header>
        <h1>最新文章</h1>
      </header>
      
      <article class="mini-post">
        <section>
          
  <a href="/blog/css%E5%AD%A6%E4%B9%A0%E4%B8%80/" class="image featured">
    
      <img src="https://raw.githubusercontent.com/hhs44/cloudimg/master/img/20200331114355.png" alt="">
    
  </a>


        </section>
        <header>
          <h1><a href="/blog/css%E5%AD%A6%E4%B9%A0%E4%B8%80/">CSS学习一</a></h1>
          <time class="published" datetime="">March 31, 2020</time>
        </header>
      </article>
      
      <article class="mini-post">
        <section>
          
  <a href="/blog/html%E5%AD%A6%E4%B9%A0%E4%B8%80/" class="image featured">
    
      <img src="https://raw.githubusercontent.com/hhs44/cloudimg/master/img/20200331114355.png" alt="">
    
  </a>


        </section>
        <header>
          <h1><a href="/blog/html%E5%AD%A6%E4%B9%A0%E4%B8%80/">HTML学习一</a></h1>
          <time class="published" datetime="">March 31, 2020</time>
        </header>
      </article>
      
      <article class="mini-post">
        <section>
          
  <a href="/blog/web%E5%9F%BA%E7%A1%80/" class="image featured">
    
      <img src="https://raw.githubusercontent.com/hhs44/cloudimg/master/img/20200331114355.png" alt="">
    
  </a>


        </section>
        <header>
          <h1><a href="/blog/web%E5%9F%BA%E7%A1%80/">web基础</a></h1>
          <time class="published" datetime="">March 31, 2020</time>
        </header>
      </article>
      
      
        <a href="/blog/" class="button">查看更多</a>
      
    </section>
  

  
    
      <section id="categories">
        <header>
          <h1><a href="/categories">分类</a></h1>
        </header>
        <ul>
          
            
          
          
          <li>
            
              <a href="/categories/python/">python<span class="count">6</span></a>
            
          
          <li>
            
              <a href="/categories/linux/">linux<span class="count">4</span></a>
            
          
          <li>
            
              <a href="/categories/web/">web<span class="count">4</span></a>
            
          
          <li>
            
              <a href="/categories/hexo/">hexo<span class="count">3</span></a>
            
          
          <li>
            
              <a href="/categories/jetbrain/">jetbrain<span class="count">2</span></a>
            
          
          <li>
            
              <a href="/categories/test/">test<span class="count">2</span></a>
            
          
          <li>
            
              <a href="/categories/%E5%89%8D%E7%AB%AF/">前端<span class="count">2</span></a>
            
          
          <li>
            
              <a href="/categories/%E6%95%B0%E6%8D%AE%E5%BA%93/">数据库<span class="count">2</span></a>
            
          
          <li>
            
              <a href="/categories/conda/">conda<span class="count">1</span></a>
            
          
          <li>
            
              <a href="/categories/development/">development<span class="count">1</span></a>
            
          
          <li>
            
              <a href="/categories/golang/">golang<span class="count">1</span></a>
            
          
          <li>
            
              <a href="/categories/java/">java<span class="count">1</span></a>
            
          
          <li>
            
              <a href="/categories/syntax/">syntax<span class="count">1</span></a>
            
          
          <li>
            
              <a href="/categories/%E9%80%9A%E4%BF%A1/">通信<span class="count">1</span></a>
            
          
          </li>
        </ul>
      </section>
    
  

  
    <section id="mini-bio">
      <header>
        <h1>关于</h1>
      </header>
      <p>test</p>
      <footer>
        <a href="/about" class="button">了解更多</a>
      </footer>
    </section>
  
</section>

      <footer id="site-footer">
  
      <ul class="socnet-icons">
        

        <li><a href="//github.com/hhs44/hhs44.github.io" target="_blank" rel="noopener" title="GitHub" class="fab fa-github"></a></li>






<li><a href="//flickr.com/photos/example" target="_blank" rel="noopener" title="Flickr" class="fab fa-flickr"></a></li>




<li><a href="//linkedin.com/in/example" target="_blank" rel="noopener" title="LinkedIn" class="fab fa-linkedin"></a></li>
<li><a href="//linkedin.com/company/examplebusiness" target="_blank" rel="noopener" title="LinkedIn Company" class="fab fa-linkedin"></a></li>



<li><a href="//facebook.com/example" target="_blank" rel="noopener" title="Facebook" class="fab fa-facebook"></a></li>
<li><a href="//reddit.com/user/example" target="_blank" rel="noopener" title="Reddit" class="fab fa-reddit"></a></li>





<li><a href="weixin://contacts/profile/22" target="_blank" rel="noopener" title="WeChat" class="fab fa-weixin"></a></li>
<li><a href="//wpa.qq.com/msgrd?v=3&amp;uin=1159986871&amp;site=qq&amp;menu=yes" target="_blank" rel="noopener" title="QQ" class="fab fa-qq"></a></li>
<li><a href="//instagram.com/example" target="_blank" rel="noopener" title="Instagram" class="fab fa-instagram"></a></li>

<li><a href="//twitter.com/example" target="_blank" rel="noopener" title="Twitter" class="fab fa-twitter"></a></li>


<li><a href="//pinterest.com/example" target="_blank" rel="noopener" title="Pinterest" class="fab fa-pinterest-p"></a></li>
<li><a href="//telegram.me/example" target="_blank" rel="noopener" title="telegram" class="fab fa-telegram"></a></li>



<li><a href="//researchgate.net/profile/example" target="_blank" rel="noopener" title="Research Gate"><i class="ai ai-researchgate"></i></a></li>
<li><a href="//keybase.io/example" target="_blank" rel="noopener" title="keybase" class="fab fa-keybase"></a></li>
<li><a href="//example.com/@example" target="_blank" rel="noopener" title="mastodon" class="fab fa-mastodon"></a></li>
<li><a href="mailto:1159986871@qq.com" target="_blank" title="Email" class="far fa-envelope"></a></li>

      </ul>
  
  <p class="copyright">
    
      &copy; 2020
      
        Huanghs blog
      
    . <br>
    主题: <a href='https://themes.gohugo.io/hugo-future-imperfect-slim/' target='_blank' rel='noopener'>Hugo Future Imperfect Slim</a><br>移植自 <a href='https://html5up.net/future-imperfect' target='_blank' rel='noopener'>HTML5 UP</a> | 由 <a href='https://gohugo.io/' target='_blank' rel='noopener' title='0.66.0'>Hugo</a> 驱动
  </p>
</footer>
<a id="back-to-top" href="#" class="fas fa-arrow-up fa-2x"></a>

      <script src="/js/highlight.pack.js"></script>
    <script>hljs.initHighlightingOnLoad();</script><script src="/js/bundle.min.b17fef5a58c033a8a59f57c83aa975a251aecff921cbd36c12e975d530fa023b.js" integrity="sha256-sX/vWljAM6iln1fIOql1olGuz/khy9NsEul11TD6Ajs="></script>
    <script src="/js/add-on.js"></script>
    </div>
  </body>
</html>
